<?php

/**
 * Framework_Presenter_EzPdf
 *
 * @author Application Support Group
 * @package BAMF
 * @filesource
 */

require_once('ezpdf/class.ezpdf.php');

/**
 * Framework_Presenter_EzPdf
 *
 * This presenter uses the ezpdf class (see http://www.ros.co.nz/pdf for
 * documentation on how to use this class)
 *
 * @author Application Support Group
 * @package BAMF
 */
class Framework_Presenter_EzPdf extends Framework_Presenter_Common
{
 	const CLASS_PREFIX = 'Presentation_EzPdf_';
 	protected $ezPdf = null;
 
 	/**
     * __construct
     *
	 * @author Application Support Group
     * @access public
     * @param mixed $module Instance of Framework_Module
     * @return void
     */
    public function __construct(Framework_Module $module)
    {
        parent::__construct($module);
        $className = self::CLASS_PREFIX.get_class( $this->module ) ;
        $this->ezPdf = new $className();
    }

    /**
     * display
     *
     * This function passes data to the new EzPdf object for display.
     *
     * @author Application Support Group
     * @return void
     */

    public function display()
    {
		if( file_exists( CONFIG_INI )) {
			$config = parse_ini_file( CONFIG_INI, true ) ;
		}

		foreach ($this->module->getData() as $var => $val) {
			$this->ezPdf->assign($var, $val);
		}
		
		$this->ezPdf->display();
    }

    public function __destruct()
    {
        parent::__destruct();
    }
}

?>